package com.biancheng.biancheng.biancheng6;

import java.util.Scanner;

public class 重排序字符串使得字符串相邻字符不相同 {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String res = reorganizeString(str);
        System.out.println(res);
    }

        public static String reorganizeString(String S){
            int len=S.length();
            int []eng=new int[26];
            char []c_str=S.toCharArray();
            int max_num=0;
            char tmp_c=0;
            for(int i=0;i<len;i++){
                eng[c_str[i]-'a']++;
            }
            for(int i=0;i<26;i++){
                if(max_num<eng[i]){
                    max_num=eng[i];
                    tmp_c=(char)(i+'a');
                }
            }
            if(max_num>(len+1)/2){
                return "";
            }
            int index=0;
            for(int i=0;i<max_num;i++){
                c_str[index]=tmp_c;
                eng[tmp_c-'a']--;
                index+=2;
            }
            for(int i=0;i<26;i++){
                while(eng[i]-->0){
                    if(index>=len){
                        index=1;
                    }
                    c_str[index]=(char)(i+'a');
                    index+=2;
                }
            }
            return new String(c_str);
        }



}
